/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 ******************************************************************************/

package org.reliablesource.pleiades;

import java.util.LinkedList;
import java.util.List;

import org.reliablesource.model.core.ReliableNode;

/**
 * @since 3.2
 * 
 */
public class ReliableResource extends ReliableNode {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	protected AbstractReliableContext context;
	protected List<String> tagList;

	public ReliableResource() {
		super();
		tagList = new LinkedList<String>();
	}

	public AbstractReliableContext getContext() {
		return context;
	}

	public void setContext(final AbstractReliableContext _context) {
		context = _context;
	}

	public String[] getTags() {
		return tagList.toArray(new String[tagList.size()]);
	}

	public boolean submitTag(final String _tag) {
		if (null != _tag)
			if (!tagList.contains(_tag))
				return tagList.add(_tag);
		return false;
	}
}
